//声明: 该文件需要 swiper,jqueryui,common,toast,jquery

require(["config"], function(config) {
	require(["com", "jquery","sw"] ,function(com, jq,sw){
		/*
			function setCookie(key, val, expires){
				var now = new Date();
				now.setDate( now.getDate()+expires );
				document.cookie = key+"="+val+"; expires="+now;
			}
			
			function getCookie(key){
				var cookiestr = document.cookie;
				var list = cookiestr.split("; ");
				for(var attr in list){
					var kv = list[attr].split("=");
					if(kv[0] == key){
						return kv[1];
					}
				}
				return "";
			}*/
			
		//存cookie
		
			
		$("#start").click(function(){
			var usename1 = $("#t_UserName").val();
			var password1 = $("#t_UserPass").val();
			
			if(password1.length==0){
				alert("请输入账号或密码");
				return;
			}else{		
				if(com.getCookie(usename1)==password1){
					com.setCookie("names",usename1,10);
					location.href = "index.html";
				}else{
					alert("您输入有误。请重新输入");
				}
			}
			
		})
		
		

	});
})